<template>
  <div class="hm-header">
    <div class="left" v-if="showArrow" @click="$emit('clickLeft')">&lt;</div>
    <div class="center"><slot name="center">我是标题</slot></div>
    <div class="right"><slot name="right"></slot></div>
  </div>
</template>

<script>
export default {
  props: {
    showArrow: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="less" scoped>
.hm-header {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 10px;
  justify-content: space-between;
  background-color: orange;
  border-bottom: 1px solid #000;

  .center {
    flex: 1;
    text-align: center;
  }
}
</style>
